package cn.ad.server.domain.ad;

import cn.ad.server.domain.enumration.AdFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

public class AdSpace implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8306525843535989559L;

	static final String VERSION = "0";
	static final String CACHE_NAME = "adspace";

	private long id;
	private String name;
	private String description;
	private Ratio ratio;
	private PubSite pubSite;
	private AdFormat adFormat;
	private AdTemplate adTemplate;
	private String materialFormat;
	private int os;
	private int volumeLimit;
	private int buyType;
	private int chargeType;
	private BigDecimal chargePrice;
	private Creative defaultCreative;
	private int defaultCreativeOption;
	private int status;
	private Date createTime;
	private Date updateTime;

	private List<Strategy> strategys;
	
	private Strategy matchStrategy;
	private Creative matchCreative;
	private List<AdMaterial> matchAdMaterials;
	private AdMaterial matchAdMaterial;
	private List<AdMaterialGroup> matchAdMaterialGroups;
	
	private List<AdSpaceAdxMap> adSpaceAdxMaps;

	public Strategy getMatchStrategy() {
		return matchStrategy;
	}

	public void setMatchStrategy(Strategy matchStrategy) {
		this.matchStrategy = matchStrategy;
	}

	public Creative getMatchCreative() {
		return matchCreative;
	}

	public void setMatchCreative(Creative matchCreative) {
		this.matchCreative = matchCreative;
	}

	public List<AdMaterial> getMatchAdMaterials() {
		return matchAdMaterials;
	}

	public void setMatchAdMaterials(List<AdMaterial> matchAdMaterials) {
		this.matchAdMaterials = matchAdMaterials;
	}

	public AdMaterial getMatchAdMaterial() {
		return matchAdMaterial;
	}

	public void setMatchAdMaterial(AdMaterial matchAdMaterial) {
		this.matchAdMaterial = matchAdMaterial;
	}

	public List<AdMaterialGroup> getMatchAdMaterialGroups() {
		return matchAdMaterialGroups;
	}

	public void setMatchAdMaterialGroups(List<AdMaterialGroup> matchAdMaterialGroups) {
		this.matchAdMaterialGroups = matchAdMaterialGroups;
	}

	public static String cacheKey(long id) {
		return new StringBuilder(CACHE_NAME).append(":").append(VERSION).append(":").append(id).toString();
	}

	public String toCacheKey() {
		return new StringBuilder(CACHE_NAME).append(":").append(VERSION).append(":").append(this.getId()).toString();
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Ratio getRatio() {
		return ratio;
	}

	public void setRatio(Ratio ratio) {
		this.ratio = ratio;
	}

	public PubSite getPubSite() {
		return pubSite;
	}

	public void setPubSite(PubSite pubSite) {
		this.pubSite = pubSite;
	}

	public AdFormat getAdFormat() {
		return adFormat;
	}

	public void setAdFormat(AdFormat adFormat) {
		this.adFormat = adFormat;
	}

	public AdTemplate getAdTemplate() {
		return adTemplate;
	}

	public void setAdTemplate(AdTemplate adTemplate) {
		this.adTemplate = adTemplate;
	}

	public String getMaterialFormat() {
		return materialFormat;
	}

	public int getOs() {
		return os;
	}

	public void setOs(int os) {
		this.os = os;
	}

	public void setMaterialFormat(String materialFormat) {
		this.materialFormat = materialFormat;
	}

	public int getVolumeLimit() {
		return volumeLimit;
	}

	public void setVolumeLimit(int volumeLimit) {
		this.volumeLimit = volumeLimit;
	}

	public int getBuyType() {
		return buyType;
	}

	public void setBuyType(int buyType) {
		this.buyType = buyType;
	}

	public int getChargeType() {
		return chargeType;
	}

	public void setChargeType(int chargeType) {
		this.chargeType = chargeType;
	}

	public BigDecimal getChargePrice() {
		return chargePrice;
	}

	public void setChargePrice(BigDecimal chargePrice) {
		this.chargePrice = chargePrice;
	}

	public Creative getDefaultCreative() {
		return defaultCreative;
	}

	public void setDefaultCreative(Creative defaultCreative) {
		this.defaultCreative = defaultCreative;
	}

	public int getDefaultCreativeOption() {
		return defaultCreativeOption;
	}

	public void setDefaultCreativeOption(int defaultCreativeOption) {
		this.defaultCreativeOption = defaultCreativeOption;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public List<Strategy> getStrategys() {
		return strategys;
	}

	public void setStrategys(List<Strategy> strategys) {
		this.strategys = strategys;
	}

	public List<AdSpaceAdxMap> getAdSpaceAdxMaps() {
		return adSpaceAdxMaps;
	}

	public void setAdSpaceAdxMaps(List<AdSpaceAdxMap> adSpaceAdxMaps) {
		this.adSpaceAdxMaps = adSpaceAdxMaps;
	}
	
}
